<template>
  <div class="card-color card-margin">
    <div class="user-notebook-info" >
      <div class="head-item card-header"><i class="el-icon-connection" />&nbsp;文章目录</div>
        <template v-show="$store.state.catalogs">
          <div v-bind:key="item.key" v-for="item in $store.state.catalogs" class="catalog-item">
            <template v-if="item.key === 'H1'"><span class="h1 text2">{{item.text}}</span></template>
            <template v-if="item.key === 'H2'"><span class="h2 text2">{{item.text}}</span></template>
            <template v-if="item.key === 'H3'"><span class="h3 text2">{{item.text}}</span></template>
            <template v-if="item.key === 'H4'"><span class="h4 text2">{{item.text}}</span></template>
            <template v-if="item.key === 'H5'"><span class="h5 text2">{{item.text}}</span></template>
          </div>
        </template>
    </div>
  </div>
</template>

<script>
import request from '@/utils/request'
export default {
  name: 'catalog',
  data: function () {
    return {
    }
  },
  computed: {
  },
  watch: {
  },
  created () {
  },
  methods: {
  }
}
</script>

<style>
  .catalog-item{
    display: flex;
    flex-direction: row;
    text-align: left;
    padding-left: 5px;
    font-size:13px;
    font-weight: bold;
    white-space: nowrap;
    width: 240px;
    overflow: hidden;
    text-overflow:ellipsis;
    height: 42px;
    line-height: 42px;
  }
  .catalog-item:hover {
    color: darkblue;
  }

  .h1 {
    font-size: 15px;
    padding-left: 3px;
  }
  .h2 {
    font-size: 14px;
    padding-left: 6px;
  }
  .h3 {
    font-size: 13px;
    padding-left: 9px;
    color: #656565;
  }
  .h4 {
    font-size: 13px;
    padding-left: 12px;
    color: #656565;
  }
  .h5 {
    font-size: 13px;
    padding-left: 15px;
    color: #656565;
  }

</style>
